var path = require('path')
var webpack = require('webpack')
//页面模板插件
const HtmlWebpackPlugin = require('html-webpack-plugin')


module.exports = {

    entry: {
        'rtfToHtml': './src/rtfToHtml/index.js'
    },

   

    output: {
        path: path.resolve(__dirname, './dist'),
        filename: "[name].min.js",
        library: "rtfToHtml",//导出的库名称
        libraryTarget: 'umd'
    },

    resolve: {
        alias: {
            '@': path.resolve('src'),
            //'vue$': 'vue/dist/vue.esm.js' //https://blog.csdn.net/wxl1555/article/details/83187647
        }
    },


    //配置server
    devServer: {
        contentBase: "./dist",
        open: true ,//自动打开浏览器
        port: 8088
    },

    plugins: [
        //https://www.npmjs.com/package/readable-stream
        new webpack.ProvidePlugin({
            process: 'process/browser'
        }),
        //生成html
		new HtmlWebpackPlugin({
			filename: 'index.html',
		    template: path.resolve(__dirname, './index.html'),
		    title:'rtf to html'
		}),
    ],

    

    module: {

        rules: [
            
        ]


    }

}